package edu.nf.bs.controller;

import com.github.pagehelper.PageInfo;
import edu.nf.bs.dao.DeliveryManMapper;
import edu.nf.bs.dao.impl.DeliveryManDaoImpl;
import edu.nf.bs.entity.DeliveryMan;
import edu.nf.bs.service.impl.DeliveryServiceImpl;
import edu.nf.bs.vo.ResultVO;
import org.mvc.web.annotation.RequestMapping;
import org.mvc.web.servlet.View;
import org.mvc.web.view.JsonView;

import java.util.List;

public class DeliveryManContraller extends BaseContraller{
    /**
     * 列表查询
     * @param page 传过来的固定分页参数
     * @param limit 传过来的固定分页参数
     * @return
     */
    @RequestMapping("/deliveryMan/query")
    public View queryDeliveryMan(String deliveryManName,Integer page, Integer limit){
        DeliveryManMapper mapper=new DeliveryManDaoImpl();
        DeliveryServiceImpl service = new DeliveryServiceImpl();
        service.setDeliveryManMapper(mapper);
        PageInfo<DeliveryMan> pageInfo = service.queryDeliveryMan(deliveryManName,page,limit);
        ResultVO<List<DeliveryMan>> vo = page(pageInfo);
        return new JsonView(vo);
    }
}
